/*
 * Copyright 2012 Marsrutai.lt
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package lt.marsrutai.mobile.android.activity.intent;

import java.util.List;

import lt.marsrutai.mobile.android.activity.PointSelectionMapActivity;
import lt.marsrutai.mobile.android.activity.PointSelectionMapActivity.MarkerInfo;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class PointSelectionIntentHolder extends IntentHolder {

    private static final String MARKERS = "markers";
    private static final String MAX_POINTS = "maxPoints";

    public PointSelectionIntentHolder(Activity sourceActivity) {
        super(sourceActivity, PointSelectionMapActivity.class);
    }

    public PointSelectionIntentHolder(Intent intent) {
        super(intent);
    }

    public PointSelectionIntentHolder(Bundle bundle) {
        super(bundle);
    }

    public void setMarkers(List<MarkerInfo> markers) {
        setCollection(MARKERS, markers, MarkerInfo.class);
    }

    public List<MarkerInfo> getMarkers() {
        return getList(MARKERS);
    }
    
    public void setMaxPoints(int maxPoints) {
        intent.putExtra(MAX_POINTS, maxPoints);
    }
    
    public int getMaxPoints() {
        return intent.getIntExtra(MAX_POINTS, 0);
    }

}
